<?php
require_once 'db.php';
$sql = 'select * from user where UserID = :id';
$sth = $db->prepare ($sql);
$sth->bindParam (':id', $_GET['id']);
$sth->execute ();
$row = $sth->fetch ();
header ("Content-type: image");
echo $row['Portrait'];
?>